package com.ler.yrmall.coupon.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author Leron
 * @version 1.0
 * 秒杀 sku redis 缓存
 */
@Data
public class SeckillSkuDTO implements Serializable {

    /**
     * id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long seckillId;

    /**
     * skuId
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long skuId;

    /**
     * 秒杀价格
     */
    private BigDecimal seckillPrice;

    /**
     * 限购数量
     */
    private Integer count;

    /**
     * 每人限购数量
     */
    private Integer limited;

    /**
     * 排序
     */
    private Integer sort;

    private String randomCode;


    /**
     * spuId
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long spuId;

    /**
     * sku
     */
    private String skuName;

    /**
     * sku
     */
    private String skuDesc;

    /**
     * 品牌
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long brandId;

    /**
     * 封面
     */
    private String cover;

    /**
     * 原价
     */
    private BigDecimal price;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;

}
